package publics.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;


@Entity
@Table(name="account_receivable")
public class AccountReceivable {//主要应收账款
	
	 private Integer id;// ID int not null,
	 private Enterprise ent;
	 private String companyName;//应收账款单位名称   varchar(40) not null,
	 private Float money;//金额（元）  float not null,
	 private String age;//账龄备注  varchar(20),
	   //primary key (Acc_rec_id)
	 @Id
	 @GeneratedValue
	 @Column(name="Acc_rec_id")
	public Integer getId() {
		return id;
	}


	 @ManyToOne(fetch=FetchType.LAZY)
	 @JoinColumn(name="Ent_id",nullable=false)
	public Enterprise getEnt() {
		return ent;
	}
	 @Column(name="Acc_rec_company_name")
	public String getCompanyName() {
		return companyName;
	}
	 @Column(name="Acc_rec_money")
	public float getMoney() {
		return money;
	}
	 @Column(name="Acc_rec_account_age")
	public String getAge() {
		return age;
	}

	public void setId(Integer id) {
		this.id = id;
	}
	public void setEnt(Enterprise ent) {
		this.ent = ent;
	}
	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}
	public void setMoney(Float money) {
		this.money = money;
	}
	public void setAge(String age) {
		this.age = age;
	}


	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "AccountReceivable [age=" + age + ", companyName=" + companyName
				+ ", ent=" + ent + ", id=" + id + ", money=" + money + "]";
	}
	 
    
}
